from dotenv import load_dotenv
import os

# 加载.env文件
load_dotenv(dotenv_path="./config/.env")


class ConfigUtil:
    @staticmethod
    def get_test_url():
        return os.getenv("TEST_URL")

    @staticmethod
    def get_browser():
        return os.getenv("BROWSER", "chrome")  # 默认chrome

    # 数据库配置
    @staticmethod
    def get_db_config():
        return {
            "host": os.getenv("DB_HOST"),
            "port": int(os.getenv("DB_PORT")),
            "user": os.getenv("DB_USER"),
            "password": os.getenv("DB_PASS"),
            "database": os.getenv("DB_NAME")
        }